package com.zidongxiangxi.sharding.job.core.node;

import com.zidongxiangxi.sharding.job.core.storage.NodeStorage;
import lombok.Getter;

/**
 * 抽象节点
 *
 * @author chenxudong
 * @date 2021/02/18
 */
public class AbstractNode {
    @Getter
    protected final String jobName;
    @Getter
    protected final NodeStorage storage;

    AbstractNode(final String jobName, NodeStorage storage) {
        this.jobName = jobName;
        this.storage = storage;
    }

    String getFullPath(String subPath) {
        return AbstractNode.getFullPath(jobName, subPath);
    }

    public static String getFullPath(String jobName, String subPath) {
        return String.format("/%s/%s", jobName, subPath);
    }
}
